package com.yangl.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yangl.dao.UserDao;
import com.yangl.domain.User;

import java.util.List;

@Service  
public class UserServiceImpl implements UserService {

	@Autowired  
    private UserDao userDao;
  
    public User selectUserById(Integer userId) {  
        return userDao.selectUserById(userId);

    }

    public List<User> selectUserAll(){
      return  userDao.selectUserAll();
    }

    public boolean addUser(User user){
      return userDao.addUser(user);
    }

    public boolean update(User user) {
        if (userDao.updateUserById(user) ) {
            return true;
        }
        return false;
    }

    public boolean deleteUserById(int id) {
        if (userDao.deleteUserById(id)) {
            return true;
        }
        return false;
    }
}
